﻿using System;
using System.Data;
using System.Data.Common;
using Liger.Common;
using Liger.Data;

namespace EasyFMS.Model
{

	/// <summary>
	/// 实体类zDepartment
	/// </summary>
	[Serializable]
	public class zDepartment : Entity 
	{ 
		 public zDepartment() 
            : base("zDepartment") 
        { 

        }


		#region Model
		private int? _depcode;
		private string _depname;
		private int? _supdepcode;
		private int? _compcode;
		private string _depstatus;
	 
		/// <summary>
		/// 
		/// </summary>
		public int? depcode
		{
			get{ return _depcode; }
			set
			{
				this.OnPropertyValueChange(_.depcode,_depcode,value);
				this._depcode = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string depname
		{
			get{ return _depname; }
			set
			{
				this.OnPropertyValueChange(_.depname,_depname,value);
				this._depname = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public int? supdepcode
		{
			get{ return _supdepcode; }
			set
			{
				this.OnPropertyValueChange(_.supdepcode,_supdepcode,value);
				this._supdepcode = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public int? compcode
		{
			get{ return _compcode; }
			set
			{
				this.OnPropertyValueChange(_.compcode,_compcode,value);
				this._compcode = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string depstatus
		{
			get{ return _depstatus; }
			set
			{
				this.OnPropertyValueChange(_.depstatus,_depstatus,value);
				this._depstatus = value;
			}
		}
		#endregion

		#region Method
		/// <summary>
		/// 获取列信息
		/// </summary>
		public override Field[] GetFields()
		{
			return new Field[] {
				_.depcode,
				_.depname,
				_.supdepcode,
				_.compcode,
				_.depstatus
			};
		}
		/// <summary>
		/// 获取值信息
		/// </summary>
		public override object[] GetValues()
		{
			return new object[] {
				_depcode,
				_depname,
				_supdepcode,
				_compcode,
				_depstatus
			};
		} 
		/// <summary>
		/// 设置字段值
		/// </summary>
		public override void SetValue(string fieldName, object value)
        {
            switch (fieldName)
            { 
				case "depcode":
                    this._depcode = DataHelper.ConvertValue<int?>(value);
                    break; 
				case "depname":
                    this._depname = DataHelper.ConvertValue<string>(value);
                    break; 
				case "supdepcode":
                    this._supdepcode = DataHelper.ConvertValue<int?>(value);
                    break; 
				case "compcode":
                    this._compcode = DataHelper.ConvertValue<int?>(value);
                    break; 
				case "depstatus":
                    this._depstatus = DataHelper.ConvertValue<string>(value);
                    break; 
            }
        }
		/// <summary>
		/// 获取字段值
		/// </summary>
        public override object GetValue(string fieldName)
        {
            switch (fieldName)
            { 
				case "depcode":
                    return this._depcode; 
				case "depname":
                    return this._depname; 
				case "supdepcode":
                    return this._supdepcode; 
				case "compcode":
                    return this._compcode; 
				case "depstatus":
                    return this._depstatus; 
				default :
                    return null;
            } 
        }



		#endregion

		#region _Field
		/// <summary>
		/// 字段信息
		/// </summary>
		public class _
		{
			/// <summary>
			/// * 
			/// </summary>
			public readonly static Field All = new Field("*","zDepartment");
 
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field depcode = new Field("depcode","zDepartment","depcode");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field depname = new Field("depname","zDepartment","depname");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field supdepcode = new Field("supdepcode","zDepartment","supdepcode");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field compcode = new Field("compcode","zDepartment","compcode");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field depstatus = new Field("depstatus","zDepartment","depstatus");
		}
		#endregion

 
	}
}

